package com.situ.shop.model.DTO;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.situ.model.ProductCategory;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 秒杀商品及其关联商品信息的DTO类
 */
@Getter
@Setter
public class SecKillProductWithProductInfo {
    // 秒杀商品字段
    private Integer id; //秒杀商品id

    private Integer productId; //关联商品id

    private BigDecimal seckillPrice; //秒杀价格

    private Integer stock; //秒杀库存

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime; //秒杀开始时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime; //秒杀结束时间

    private LocalDateTime createdAt; //创建时间

    private LocalDateTime updatedAt; //更新时间

    // 关联商品字段
    private Integer pId; //商品ID

    private Integer categoryId; //商品分类ID

    private String name; //商品名称

    private BigDecimal price; //商品原价

    private Integer pStock; //商品库存

    private String description; //商品描述

    private String coverImage; //商品封面图片

    private String detailImages; //商品详情图片

    private Integer isSeckill; //是否秒杀商品 (1：是  0：否)

    private Integer isOnSale; //是否上架 (1：是  0：否)

    private LocalDateTime pCreatedAt; //商品创建时间

    private LocalDateTime pUpdatedAt; //商品更新时间

    @TableField(exist = false)
    private ProductCategory category;

    private Integer status; //0:上架中  1:上架

    private String avatar;
}
